<template>
	<div class="contanis" style="padding-top: 10px;">
		 <div class="category-name"><span>经销商</span></div>
		 <div class="category_item-list">
			  <div class="category_item" @click="toShoperRegister" v-if="user['type']==1">
                   <image src="../../assets/images/b_1.gif" mode=""></image>
			  </div>
			  <div class="category_item" @click="toShopRegister" v-if="user['type']==1">
			       <image src="../../assets/images/b_1.gif" mode=""></image>
			  </div>
			  <div class="category_item" v-if="user['type']==2">
				    <image src="../../assets/images/b_2.gif" mode=""></image>
			  </div>
			  <div class="category_item" v-if="user['type']==2">
				   <image src="../../assets/images/b_4.png" mode=""></image>
			  </div>
			  <div class="category_item" v-if="user['type']==3" @click="toShopVerify" >
			  	   <image src="../../assets/images/b_2.gif" mode=""></image>
			  </div>
		 </div>
	</div>
</template>
<script>
	import { shoperRegister } from '../../../api/index.js';
	export default {
	  components:{
	  },
	  data(){
		 return {
			 is_login:false,
			 user:[],
		 }
	  },
	  onShow() {
		 var isLogin = this.$Fun.checkLogin((res)=>{
			 this.user = res;
			 this.is_login = true;
		 });
		 if (isLogin==false){
			 uni.showToast({
				icon:'none', 
			 	title:"请先登录",
			 });
			 setTimeout(res=>{
				 uni.switchTab({
					 'url':'/pages/views/mine/index',
				 });
			 },2000);
		 }
	  },
	  created(){
	  },
	  mounted(){
	  },
	  methods:{
		toShoperRegister(){
			uni.navigateTo({
				url:'/pages/views/shoper_register/index'
			})
		},
		toShopRegister(){
		 	uni.navigateTo({
		 		url:'/pages/views/shop_register/index'
		 	})
		},
		 toShopVerify(){
			 uni.navigateTo({
			 	url:'/pages/views/shop_verify/index'
			 })
		 }
	  },
	};
</script>

<style>
	.category-name { width: 80%; height: 30px; margin: 0 auto;}
	.category-name span { display: inline-block; width:auto; padding: 0 5px; height: 25px; border-bottom:1px solid deepskyblue;}
	.category_item-list { width: 80%; height: auto; padding-top: 20px; margin: 0 auto;}
	.category_item { width: 100%; height: 150px; margin-bottom: 20px;}
	.category_item image { width: 100%; height: 100%;}
</style>